# Contributor: Michael Pirogov <vbnet.ru@gmail.com>
# Maintainer: Michael Pirogov <vbnet.ru@gmail.com>
pkgname=nsq
pkgver=1.3.0
pkgrel=5
pkgdesc="A realtime distributed messaging platform"
url="https://nsq.io/"
arch="all"
license="MIT"
depends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/nsqio/nsq/archive/v$pkgver.tar.gz
	no-fmt.patch
	more-test-procs.patch
	"
options="net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

prepare() {
	default_prepare
	go mod download
}

build() {
	make
}

check() {
	./test.sh
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin/ build/*
}

sha512sums="
5d466c3675dbccd99b5ad4f691968d3396af0a92630b850cd36e9ffb0c8d00a6f43cf5617a0fa0d78876dfd65ae496e79fa72da5707b04397e0444529d2e88d6  nsq-1.3.0.tar.gz
7d7ac1942dbeea48b90fe9e2a88f06c9d197c0c55949ab435edf5e6b3c174c38357749306232f56f26dc2513d049327242bb03c4b655d75db642f28015ad5b58  no-fmt.patch
771822f35ba925a1e8a93d3d29c6f8afb9f23e354f50ece7dc360584db52a2c7ba260397827dcc780f3972d7b37d941e910a5702ce8b9c818fc8eeb3eea1265a  more-test-procs.patch
"
